//
//  YDBaseController.m
//  YDBASE
//
//  Created by rowena on 2019/4/22.
//  Copyright © 2019年 wuyezhiguhun. All rights reserved.
//

#import "YDBaseController.h"
#import <YDExtension/YDExtension.h>

@interface YDBaseController ()

@property (nonatomic, strong) UIImageView *backImageView;

@end

@implementation YDBaseController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.backImageView];
    [self setNavigationItem];
    
    // Do any additional setup after loading the view.
}

- (void)setNavigationItem {
    if ([self.navigationController.viewControllers count] > 1) {
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"arrow_left"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarButtonItemTouch)];
    }
}
- (void)leftBarButtonItemTouch {
    [self.navigationController popViewControllerAnimated:YES];
}

- (UIImageView *)backImageView {
    if (!_backImageView) {
        _backImageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _backImageView.image = [UIImage yd_getLaunchPortraitImage];
    }
    return _backImageView;
}

@end
